from tensorflow import keras  # 导入 TF 子库 keras
from tensorflow.keras import layers, optimizers, datasets  # 导入 TF 子库等

if __name__ == '__main__':
    # 自动加载 IMDB 电影评价数据集
    (x_train, y_train), (x_test, y_test) = keras.datasets.imdb.load_data(num_words=10000)
    x_train=keras.preprocessing.sequence.pad_sequences(x_train,maxlen=80)
    print(x_train.shape)
    embedding=layers.Embedding(10000,100)
    out=embedding(x_train)
    print(out.shape)


